<script setup lang="ts">
import { computed } from "vue";
import { useRoute } from "vue-router";
import useLoginStore from "@/stores/modules/login/login";
import { mapPathToBreadcrumbs } from "@/utils/mapMenus";

const route = useRoute();
const userMenus = useLoginStore().userMenus;
const breadcrumb = computed(() => {
  return mapPathToBreadcrumbs(route.path, userMenus);
})
</script>

<template>
  <div class="crumb">
    <el-breadcrumb separator-icon="ArrowRight">
      <template v-for="item in breadcrumb" :key="item.name">
        <el-breadcrumb-item :to="{ path: item.path }">{{ item.name }}</el-breadcrumb-item>
      </template>
    </el-breadcrumb>
  </div>
</template>

<style scoped></style>
